home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS03.ADF / ABasiCprogs / dice.bas < prev    next >
BASIC Source File  |  1986-04-02  |  5KB  |  188 lines

  1. 60    rem this is the routine only
  2. 62    scnclr
  3. 63    rgb 0,15,9,10
  4. 64    pena 2:penb 1
  5. 65    ?at(40,50);"CLICK UP HERE TO ROLL DICE"
  6. 66    ?AT(0,70);"CLICK BOX OF YOUR CHOICE TO MAKE BET"
  7. 70    draw(-5,110 to 329,110)
  8. 71    draw(100,110 to 100,200)
  9. 72    draw(200,110 to 200,200)
  10. 74    pena 11
  11. 75    paint(50,130),1
  12. 76    paint(280,130),1
  13. 77    pena 9:paint(120,130),1
  14. 79    pena 6:penb 11:graphic 1
  15. 80    ?at(30,150);"UNDER"
  16. 81    ?at(38,160);"1:1"
  17. 85    ?at(240,150);"OVER"
  18. 86    ?at(245,160);"1:1"
  19. 89    penb 9
  20. 90    ?at(130,150);"SEVEN"
  21. 91    ?at(138,160);"3:1"
  22. 95    penb 2
  23. 96    pena 1:x=0:y=0
  24. 97    GOSUB 660
  25. 98    goto 600
  26. 100   '
  27. 101   gshape(x-20,y-10),blank%
  28. 104   rem draw(120,118):stopTHIS           IS THE POS'N OF THE CENTER
  29. 106   p=0:q=0
  30. 108   p1=0:q1=0
  31. 110   x=-9:y=45
  32. 112   x1=-70:y1=15
  33. 114   gshape(x-28,y-26),d2%:rem D2% uses a different corner than D1%
  34. 116   gshape(x1-28,y1-26),d2%
  35. 118   sleep 1*10^5
  36. 120   gshape(x-28,y-26),blank%
  37. 122   gshape(x1-28,y1-26),blank%
  38. 124   if p=0 then x=x+20
  39. 126   if p1=0 then x1=x1+20
  40. 128   if p=1 then x=x-20
  41. 129   if p1=1 then x1=x1-20
  42. 130   if q=0 then y=y+20
  43. 131   if q1=0 then y1=y1+20
  44. 132   if q=1 then y=y-20
  45. 133   if q1=1 then y1=y1-20
  46. 134   gshape(x-20,y-18),d1%
  47. 135   gshape(x1-20,y1-18),d1%
  48. 136   sleep 1*10^5
  49. 138   if p=1 and x<80 and y>60 then 156
  50. 139   gshape(x1-28,y1-26),blank%
  51. 140   gshape(x-28,y-26),blank%
  52. 141   if p1=0 then x1=x1+20
  53. 142   if p=0 then x=x+20
  54. 144   if p=1 then x=x-20
  55. 145   if p1=1 then x1=x1-20
  56. 146   if x>270 then p=1
  57. 147   if x1>270 then p1=1
  58. 148   rem if x<-10 then p=0
  59. 150   if y>60 then q=1
  60. 151   if y1>60 then q1=1
  61. 152   if y<39 then q=0
  62. 153   if y1<39 then q1=0
  63. 154   goto 114
  64. 156   '
  65. 210   gshape(x-28,y-26),blank%
  66. 211   gshape(x1-28,y1-26),blank%
  67. 220   x=x-10
  68. 221   x1=x1-20
  69. 222   if y1<60 then y1=y1+20
  70. 240   gshape(x-28,y-26),d2%
  71. 241   gshape(x1-28,y1-26),d2%
  72. 250   sleep 1*10^5
  73. 260   gshape(x-28,y-26),blank%
  74. 261   gshape(x1-28,y1-26),blank%
  75. 270   sleep 1*10^5
  76. 280   x=x-10
  77. 281   if y1<60 then y1=y1+20
  78. 290   gshape(x-20,y-10),d1%
  79. 291   gshape(x1-20,y1-18),d1%
  80. 295   sleep 1*10^5
  81. 296   if x<120 then 300
  82. 299   goto 156
  83. 300   '
  84. 301   randomize
  85. 302   n1=int(rnd*6+1)
  86. 303   n=int(rnd*6+1)
  87. 304   if n=1 then gosub 320
  88. 305   if n=2 then gosub 326
  89. 306   if n=3 then gosub 332
  90. 307   if n=4 then gosub 340
  91. 308   if n=5 then gosub 348
  92. 309   if n=6 then gosub 358
  93. 310   x=x1:y=y1-8
  94. 311   if n1=1 then gosub 320
  95. 312   if n1=2 then gosub 326
  96. 313   if n1=3 then gosub 332
  97. 314   if n1=4 then gosub 340
  98. 315   if n1=5 then gosub 348
  99. 316   if n1=6 then gosub 358
  100. 317   goto 500
  101. 320   rem one spot
  102. 322   gosub 410
  103. 324   return
  104. 326   '
  105. 328   gosub 420
  106. 330   return
  107. 332   '
  108. 334   gosub 410
  109. 336   gosub 420
  110. 338   return
  111. 340   '
  112. 342   gosub 430
  113. 344   gosub 420
  114. 346   return
  115. 348   '
  116. 350   gosub 410
  117. 352   gosub 420
  118. 354   gosub 430
  119. 356   return
  120. 358   '
  121. 360   gosub 420
  122. 362   gosub 430
  123. 364   gosub 440
  124. 366   return
  125. 410   gshape(x-2,y+6),spot%:return
  126. 420   gshape(x-13,y+14),spot%:rem lower left
  127. 421   gshape(x+9,y-2),spot%:rem upper right
  128. 422   return
  129. 430   gshape(x-13,y-2),spot%:rem upper left
  130. 431   gshape(x+9,y+14),spot%:rem lower right
  131. 432   return
  132. 440   gshape(x-13,y+6),spot%:rem center left
  133. 441   gshape(x+9,y+6),spot%:rem center right
  134. 442   return
  135. 500   rem calculation for over/un
  136. 505   t=0
  137. 510   A=n+n1
  138. 511   if a<7 then a$="UNDER SEVEN"
  139. 512   IF A>7 then a$="OVER SEVEN"
  140. 513   if a=7 then a$="SEVEN"
  141. 515   graphic 1
  142. 520   ?at(50,100);"THE ROLL IS "A$
  143. 530   if a<7 and c=1 then ? "YOU WIN"bet*2:POT=POT+(BET*2):gosub 660:t=1
  144. 540   if a>7 and c2=1 then ? "YOU WIN"b2*2:pot=pot+(b2*2):gosub 660:t=1
  145. 550   if a=7 and c3 = 1 then ?"YOU WIN"b3*3:pot=pot+(b3*3)+b3:gosub 660:t=1
  146. 555   if t=0 then ?at(50,108);"YOU LOSE"
  147. 560   GOSUB 660
  148. 590   sleep 3*10^6
  149. 593   penb 11:?at(40,120);"    ":?at(235,120);"    ":penb 2
  150. 594   penb 9:?at (130,120);"    ":penb 2
  151. 595   ?at(30,100)"MAKE A BET OR GOTO ANOTHER GAME"
  152. 596   pena 2:penb 1:?at(0,108);"QUIT                              QUIT":pena 1:penb 2
  153. 600   '
  154. 601   bet=0:b2=0:b3=0
  155. 602   c1=0:c2=0:c3=0
  156. 610   ask mouse x%,y%,b%
  157. 611   if b%<>4 then 610
  158. 612   penb 3:?at(30,100);"                               ":?at(0,108);"                                      "
  159. 613   if x%<100 and y%>110 then gosub 620
  160. 614   if x%>200and y%>110  then gosub 630
  161. 615   if x%>100 and x%<200 and y%>110 then gosub 640
  162. 616   if y%<110 and y%>100 then chain "casino",37,all
  163. 617   if y%<100 then 100
  164. 618   goto 610
  165. 620   '
  166. 621   c=1
  167. 622   bet=bet+1:pot=pot-1
  168. 624   GOSUB 660
  169. 627   ?at(40,120);bet
  170. 628   sleep .25*10^6
  171. 629   return
  172. 630   '
  173. 631   c2=1
  174. 632   b2=b2+1:pot=pot-1
  175. 634   GOSUB 660
  176. 637   ?at(235,120);b2
  177. 638   sleep .25*10^6
  178. 639   return
  179. 640   '
  180. 641   c3=1
  181. 642   b3=b3+1:pot=pot-1
  182. 644   GOSUB 660
  183. 647   ?at(135,120);b3
  184. 648   sleep .25*10^6
  185. 649   return
  186. 650   '
  187. 660   pena 1:penb 2:?at(40,180);" YOU HAVE"POT"IN YOUR POCKET ":RETURN
  188.